﻿
Partial Class WebForm_ManageEnlistment
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Me.InitData()
        End If
    End Sub

    Protected Sub lknAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lknAdd.Click
        Me.TabContainer1.ActiveTab = Me.AddEnlistmentTabPanel
        '新增模式
        'Threading.Thread.Sleep(5000)
        Me.AddEnlistment1.DataAccessMode = FormViewMode.Insert
        Me.AddEnlistment1.InitData(0)
    End Sub

    Protected Sub QueryEnlistment1_Editing(ByVal source As Object, ByVal e As System.EventArgs) Handles QueryEnlistment1.Editing
        '單筆檢視模式
        Me.TabContainer1.ActiveTabIndex = 1
        Me.AddEnlistment1.DataAccessMode = FormViewMode.Edit
        Me.AddEnlistment1.InitData(Me.QueryEnlistment1.SelectedID)
    End Sub

    Protected Sub QueryEnlistment1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles QueryEnlistment1.SelectedIndexChanged
        '單筆檢視模式
        Me.TabContainer1.ActiveTabIndex = 1
        Me.AddEnlistment1.DataAccessMode = FormViewMode.ReadOnly
        Me.AddEnlistment1.InitData(Me.QueryEnlistment1.SelectedID)

    End Sub

    '在新增編輯頁按下存檔
    Protected Sub AddEnlistment_Save_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddEnlistment1.Save_Click
        Me.TabContainer1.ActiveTab = Me.QueryEnlistmentTabPanel
        Me.InitData()
    End Sub

    '在新增編輯頁按下簽到退
    Protected Sub AddEnlistment_Check_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddEnlistment1.Check_Click
        Me.EnlistmentPersonCheckTabPanel.Visible = True
        Me.EnlistmentPersonCheckTabPanel.HeaderText = Me.GetLocalResourceObject("EnlistmentPersonCheckTabPanel").ToString()
        Me.TabContainer1.ActiveTab = Me.EnlistmentPersonCheckTabPanel
        Me.EnlistmentPersonCheck1.InitData(AddEnlistment1.CourseID)
    End Sub

End Class

Partial Class WebForm_ManageEnlistment

    Private Sub InitData()
        Me.QueryEnlistment1.InitData()
        Me.AddEnlistment1.InitData(0)

        Me.EnlistmentPersonCheckTabPanel.Visible = False
        Me.EnlistmentPersonCheckTabPanel.HeaderText = ""
    End Sub

End Class